﻿<!doctype html>
<html>
<head>
<title></title>
<vt:include file="inc/meta.inc" />
<style type="text/css">
.btn {
	font-size: 16px;
	line-height: 30px;
	height: 30px;
	width: 100px;
	background-color: #FFC;
	text-align: center;
	border: 1px solid #6C0;
	cursor: pointer;
}
</style>
</head>
<body>
<div id="time">测试刷新（关闭子窗体，刷新父窗体）：<span></span></div>
<a class="btn" name="open" href="pagebox.cshtm">弹出窗口</a> <br/>
<a class="btn" name="getname" href="pagebox.cshtm">当前窗口名称</a><br/>

<a class="btn" name="getpath" href="pagebox.cshtm">测试路径获取</a>
</body>
<script>
$("#time span").text(new Date().Format("yyyy年M月d日 hh:mm:ss"));
</script>
<script>
$(".btn[name=open]").click(function(){
	var href=$(this).attr("href");
	var win=new window.top.PageBox("测试",href,60,60,null,window.name);
	win.CloseEvent=function(box,pbox){		
		var iframe=pbox.find("iframe");
		if(iframe.size()>0){
			iframe.attr("src",iframe.attr("src"));
		}else{
			window.location.href=window.location.href;
		}
	}
	win.Open();
	
	return false;
});
$(".btn[name=getname]").click(function(){	
	alert(window.name);
	return false;
});
$(".btn[name=getpath]").click(function(){	
	var path=window.top.PageBox.getCurrPath(window.name,$(this).attr("href"));
	alert(path);
	return false;
});
</script>
</html>
